var maxtime = 10 * 60; //
function CountDown() {
    var timer = document.getElementsByClassName("timer")
    if (maxtime >= 0) {
        minutes = Math.floor(maxtime / 60);
        seconds = Math.floor(maxtime % 60);
        msg = minutes + "分" + seconds + "秒";
        timer[0].innerHTML = msg;
        --maxtime;
    } else{
        clearInterval(timer);
        timer[0].innerHTML = "时间已经到了！订单自动取消";
    }
}
timer = setInterval("CountDown()", 1000);
function pay(index) {
    var pay = document.getElementsByClassName("pay")
    pay[0].style.display = "block"
    if (index == 1){

    }else if (index==2){
        var pay_Title = document.getElementsByClassName("pay_Title");
        var pay_Son = pay_Title[0].firstChild
        pay_Son.innerText = "支付宝支付"
        pay_Son.style.width = "120px"
        var pay_Img = pay_Title[0].lastChild
        pay_Img.style.marginLeft = "230px"
    }
    window.location.replace("/code/generation")
}
function disappear() {
    var pay = document.getElementsByClassName("pay")
    pay[0].style.display = "none"
}